<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>gdsl: gdsl_queue.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">gdsl
   &#160;<span id="projectnumber">1.7</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('gdsl__queue_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">gdsl_queue.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="gdsl__queue_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * This file is part of the Generic Data Structures Library (GDSL).</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2006 Nicolas Darnis &lt;ndarnis@free.fr&gt;.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * The GDSL library is free software; you can redistribute it and/or </span>
<a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU General Public License as </span>
<a name="l00007"></a>00007 <span class="comment"> * published by the Free Software Foundation; either version 2 of</span>
<a name="l00008"></a>00008 <span class="comment"> * the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * The GDSL library is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00016"></a>00016 <span class="comment"> * along with the GDSL library; see the file COPYING.</span>
<a name="l00017"></a>00017 <span class="comment"> * If not, write to the Free Software Foundation, Inc., </span>
<a name="l00018"></a>00018 <span class="comment"> * 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.</span>
<a name="l00019"></a>00019 <span class="comment"> *</span>
<a name="l00020"></a>00020 <span class="comment"> * $RCSfile: gdsl__queue_8h_source.html,v $</span>
<a name="l00021"></a>00021 <span class="comment"> * $Revision: 1.3 $</span>
<a name="l00022"></a>00022 <span class="comment"> * $Date: 2013/06/12 16:36:13 $</span>
<a name="l00023"></a>00023 <span class="comment"> */</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#ifndef _GDSL_QUEUE_H_</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define _GDSL_QUEUE_H_</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="gdsl__types_8h.html">gdsl_types.h</a>&quot;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> 
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 
<a name="l00054"></a><a class="code" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea">00054</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>_gdsl_queue* <a class="code" href="group__gdsl__queue.html#ga984e79831245f6a8194295299afc71ea" title="GDSL queue type.">gdsl_queue_t</a>;
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 <span class="comment">/******************************************************************************/</span>
<a name="l00057"></a>00057 <span class="comment">/* Management functions of queues                                             */</span>
<a name="l00058"></a>00058 <span class="comment">/******************************************************************************/</span>
<a name="l00059"></a>00059 
<a name="l00080"></a>00080 <span class="keyword">extern</span> gdsl_queue_t
<a name="l00081"></a>00081 <a class="code" href="group__gdsl__queue.html#ga98006ec73e032caed82bc17880072abf" title="Create a new queue.">gdsl_queue_alloc</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* NAME,
<a name="l00082"></a>00082           <a class="code" href="group__gdsl__types.html#ga32a9b4e8b9665183c2741d28a5ced64f" title="GDSL Alloc element function type.">gdsl_alloc_func_t</a> ALLOC_F,
<a name="l00083"></a>00083           <a class="code" href="group__gdsl__types.html#ga2c6b3f96b291b5b39d2799f93e350053" title="GDSL Free element function type.">gdsl_free_func_t</a> FREE_F
<a name="l00084"></a>00084           );
<a name="l00085"></a>00085 
<a name="l00099"></a>00099 <span class="keyword">extern</span> <span class="keywordtype">void</span> 
<a name="l00100"></a>00100 <a class="code" href="group__gdsl__queue.html#gae6bc99e7fd35edc3fd44a80d475e1711" title="Destroy a queue.">gdsl_queue_free</a> (gdsl_queue_t Q
<a name="l00101"></a>00101          );
<a name="l00102"></a>00102 
<a name="l00116"></a>00116 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00117"></a>00117 <a class="code" href="group__gdsl__queue.html#ga2c8f734776c50047396a222f56fe7078" title="Flush a queue.">gdsl_queue_flush</a> (gdsl_queue_t Q
<a name="l00118"></a>00118           );
<a name="l00119"></a>00119 
<a name="l00120"></a>00120 <span class="comment">/******************************************************************************/</span>
<a name="l00121"></a>00121 <span class="comment">/* Consultation functions of queues                                           */</span>
<a name="l00122"></a>00122 <span class="comment">/******************************************************************************/</span>
<a name="l00123"></a>00123 
<a name="l00133"></a>00133 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*
<a name="l00134"></a>00134 <a class="code" href="group__gdsl__queue.html#ga70db706a296922261eaa7b2c6505264e" title="Getsthe name of a queue.">gdsl_queue_get_name</a> (<span class="keyword">const</span> gdsl_queue_t Q
<a name="l00135"></a>00135              );
<a name="l00136"></a>00136 
<a name="l00144"></a>00144 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>
<a name="l00145"></a>00145 <a class="code" href="group__gdsl__queue.html#ga03760715000d25b718b416601213d6f7" title="Get the size of a queue.">gdsl_queue_get_size</a> (<span class="keyword">const</span> gdsl_queue_t Q
<a name="l00146"></a>00146              );
<a name="l00147"></a>00147 
<a name="l00156"></a>00156 <span class="keyword">extern</span> <span class="keywordtype">bool</span> 
<a name="l00157"></a>00157 <a class="code" href="group__gdsl__queue.html#ga97137e741b7bdddc993cad40dd4bf563" title="Check if a queue is empty.">gdsl_queue_is_empty</a> (<span class="keyword">const</span> gdsl_queue_t Q
<a name="l00158"></a>00158              );
<a name="l00159"></a>00159 
<a name="l00170"></a>00170 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00171"></a>00171 <a class="code" href="group__gdsl__queue.html#gac8766d595e57f262c7c7c9012226b44f" title="Get the head of a queue.">gdsl_queue_get_head</a> (<span class="keyword">const</span> gdsl_queue_t Q
<a name="l00172"></a>00172              );
<a name="l00173"></a>00173 
<a name="l00184"></a>00184 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00185"></a>00185 <a class="code" href="group__gdsl__queue.html#gabbb3ee270c3dd00915b3ff892f643d54" title="Get the tail of a queue.">gdsl_queue_get_tail</a> (<span class="keyword">const</span> gdsl_queue_t Q
<a name="l00186"></a>00186              );
<a name="l00187"></a>00187 
<a name="l00188"></a>00188 <span class="comment">/******************************************************************************/</span>
<a name="l00189"></a>00189 <span class="comment">/* Modification functions of queues                                           */</span>
<a name="l00190"></a>00190 <span class="comment">/******************************************************************************/</span>
<a name="l00191"></a>00191 
<a name="l00205"></a>00205 <span class="keyword">extern</span> gdsl_queue_t
<a name="l00206"></a>00206 <a class="code" href="group__gdsl__queue.html#gab11560279877688ad214ca3799b89124" title="Set the name of a queue.">gdsl_queue_set_name</a> (gdsl_queue_t Q,
<a name="l00207"></a>00207              <span class="keyword">const</span> <span class="keywordtype">char</span>* NEW_NAME
<a name="l00208"></a>00208              );
<a name="l00209"></a>00209 
<a name="l00225"></a>00225 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00226"></a>00226 <a class="code" href="group__gdsl__queue.html#gaea1d99dd4c2cefa1cc23bcb6fcc71aa8" title="Insert an element in a queue (PUT).">gdsl_queue_insert</a> (gdsl_queue_t Q,
<a name="l00227"></a>00227            <span class="keywordtype">void</span>* VALUE
<a name="l00228"></a>00228            );
<a name="l00229"></a>00229 
<a name="l00242"></a>00242 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00243"></a>00243 <a class="code" href="group__gdsl__queue.html#ga82b677888c8830cf524de6b0bd7f9814" title="Remove an element from a queue (GET).">gdsl_queue_remove</a> (gdsl_queue_t Q
<a name="l00244"></a>00244            );
<a name="l00245"></a>00245 
<a name="l00246"></a>00246 <span class="comment">/******************************************************************************/</span>
<a name="l00247"></a>00247 <span class="comment">/* Search functions of queues                                                 */</span>
<a name="l00248"></a>00248 <span class="comment">/******************************************************************************/</span>
<a name="l00249"></a>00249 
<a name="l00265"></a>00265 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00266"></a>00266 <a class="code" href="group__gdsl__queue.html#gad729451f16f125127cb27ebbc1716eac" title="Search for a particular element in a queue.">gdsl_queue_search</a> (<span class="keyword">const</span> gdsl_queue_t Q,
<a name="l00267"></a>00267            <a class="code" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7" title="GDSL Comparison element function type.">gdsl_compare_func_t</a> COMP_F,
<a name="l00268"></a>00268            <span class="keywordtype">void</span>* VALUE
<a name="l00269"></a>00269            );
<a name="l00270"></a>00270 
<a name="l00281"></a>00281 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00282"></a>00282 <a class="code" href="group__gdsl__queue.html#gacd42fa493e982b05f5937299cbacabf4" title="Search for an element by its position in a queue.">gdsl_queue_search_by_position</a> (<span class="keyword">const</span> gdsl_queue_t Q,
<a name="l00283"></a>00283                    <a class="code" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a> POS
<a name="l00284"></a>00284                    );
<a name="l00285"></a>00285 
<a name="l00286"></a>00286 <span class="comment">/******************************************************************************/</span>
<a name="l00287"></a>00287 <span class="comment">/* Parse functions of queues                                                  */</span>
<a name="l00288"></a>00288 <span class="comment">/******************************************************************************/</span>
<a name="l00289"></a>00289 
<a name="l00307"></a>00307 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00308"></a>00308 <a class="code" href="group__gdsl__queue.html#ga33943cf6767a0a3fc9e5445324fe6dcc" title="Parse a queue from head to tail.">gdsl_queue_map_forward</a> (<span class="keyword">const</span> gdsl_queue_t Q,
<a name="l00309"></a>00309             <a class="code" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8" title="GDSL Map element function type.">gdsl_map_func_t</a> MAP_F,
<a name="l00310"></a>00310             <span class="keywordtype">void</span>* USER_DATA
<a name="l00311"></a>00311             );
<a name="l00312"></a>00312 
<a name="l00330"></a>00330 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00331"></a>00331 <a class="code" href="group__gdsl__queue.html#ga23b534e3ef5e617544134c77340e78ae" title="Parse a queue from tail to head.">gdsl_queue_map_backward</a> (<span class="keyword">const</span> gdsl_queue_t Q,
<a name="l00332"></a>00332              <a class="code" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8" title="GDSL Map element function type.">gdsl_map_func_t</a> MAP_F,
<a name="l00333"></a>00333              <span class="keywordtype">void</span>* USER_DATA
<a name="l00334"></a>00334              );
<a name="l00335"></a>00335 
<a name="l00336"></a>00336 <span class="comment">/******************************************************************************/</span>
<a name="l00337"></a>00337 <span class="comment">/* Input/output functions of queues                                           */</span>
<a name="l00338"></a>00338 <span class="comment">/******************************************************************************/</span>
<a name="l00339"></a>00339 
<a name="l00355"></a>00355 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00356"></a>00356 <a class="code" href="group__gdsl__queue.html#ga5bd6f3af73ca88ccb369e884b3f78abf" title="Write all the elements of a queue to a file.">gdsl_queue_write</a> (<span class="keyword">const</span> gdsl_queue_t Q,
<a name="l00357"></a>00357           <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00358"></a>00358           FILE* OUTPUT_FILE,
<a name="l00359"></a>00359           <span class="keywordtype">void</span>* USER_DATA
<a name="l00360"></a>00360           );
<a name="l00361"></a>00361 
<a name="l00378"></a>00378 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00379"></a>00379 <a class="code" href="group__gdsl__queue.html#gad480dc7ccd218b6b79b2cb8385b4f3cb" title="Write the content of a queue to a file into XML.">gdsl_queue_write_xml</a> (<span class="keyword">const</span> gdsl_queue_t Q,
<a name="l00380"></a>00380               <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00381"></a>00381               FILE* OUTPUT_FILE,
<a name="l00382"></a>00382               <span class="keywordtype">void</span>* USER_DATA
<a name="l00383"></a>00383               );
<a name="l00384"></a>00384 
<a name="l00401"></a>00401 <span class="keyword">extern</span> <span class="keywordtype">void</span> 
<a name="l00402"></a>00402 <a class="code" href="group__gdsl__queue.html#ga1aa30cf9ce7bb5fa5aad5f0e55351fee" title="Dump the internal structure of a queue to a file.">gdsl_queue_dump</a> (<span class="keyword">const</span> gdsl_queue_t Q,
<a name="l00403"></a>00403          <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00404"></a>00404          FILE* OUTPUT_FILE,
<a name="l00405"></a>00405          <span class="keywordtype">void</span>* USER_DATA
<a name="l00406"></a>00406          );
<a name="l00407"></a>00407 
<a name="l00408"></a>00408 <span class="comment">/*</span>
<a name="l00409"></a>00409 <span class="comment"> * @}</span>
<a name="l00410"></a>00410 <span class="comment"> */</span>
<a name="l00411"></a>00411 
<a name="l00412"></a>00412 
<a name="l00413"></a>00413 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00414"></a>00414 <span class="preprocessor"></span>}
<a name="l00415"></a>00415 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00416"></a>00416 
<a name="l00417"></a>00417 
<a name="l00418"></a>00418 <span class="preprocessor">#endif </span><span class="comment">/* _GDSL_QUEUE_H_ */</span>
<a name="l00419"></a>00419 
<a name="l00420"></a>00420 
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="gdsl__queue_8h.html">gdsl_queue.h</a>      </li>

    <li class="footer">Generated on Wed Jun 12 2013 18:18:47 for gdsl by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
